﻿<!DOCTYPE html>



<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>物联网监控平台</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keywords" content="" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <!-- boot -->
    <link rel="stylesheet" type="text/css" href="common/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="common/css/font-awesome.min.css">
    <!--<link rel="stylesheet" type="text/css" href="common/css/layout.css">-->
    <link rel="stylesheet" type="text/css" href="common/css/layout2.css">
    <link rel="stylesheet" type="text/css" href="components/center/css/center.css">
    <link rel="stylesheet" type="text/css" href="common/css/jquery.fancybox-1.3.4.css" media="screen" />
    <script type="text/javascript" src="common/js/App.nicescroll.js" async="true"></script>
    <script type="text/javascript" src="common/js/bootstrap.min.js" async="true"></script>
    <script type="text/javascript" src="common/js/App.component.js" async="true"></script>
    <script type="text/javascript" src="common/js/App.init2.js" async="true"></script>
    <script type="text/javascript" src="common/js/jquery.js"></script>
    <script type="text/javascript" src="common/js/jquery-migrate.js"></script>
    <script type="text/javascript" src="common/js/dateutil.js"></script>
    <script type="text/javascript" src="common/js/jquery.fancybox-1.3.4.pack.js"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="common/js/html5.js"></script>
    <![endif]-->

    <script type="text/javascript" src="common/js/am.js"></script>

    <!--[if lt IE 9]>
    <script type="text/javascript">
        AM.ready(function () {
            $("html").addClass("iecss");
        })
    </script>
    <![endif]-->

</head>

<body data-menubar="true">
    <div id="header">
        <div class="sa-lay">
            <a class="logo" href="company_home.html">
                <img src="common/picture/default_logo.png" alt="" style="max-width:186px;height:50px;">
            </a>
            <ul class="hlist" id="header-nav">
                <li>
                    <a href='realtime.html' target='_top'><i class='icon icon-data-chart'></i> 数据展示</a>
                </li>
                <li>
                    <a href='analysisQuery.html' target='_top'><i class='icon icon-note'></i> 统计分析</a>
                </li>
                <li style="display: none">
                    <a href='environment.html' target='_top'><i class='icon icon-arrows'></i> 环境调控</a>
                </li>
                <li class="active">
                    <a href='center.html' target='_top'><i class='icon icon-users'></i> 用户中心</a>
                </li>
                <li>
                    <a href='projectInfo.html' target='_top'><i class='icon icon-comment-o'></i> 项目信息</a>
                </li>
            </ul>
            <ul class="hlist" id="header-btns">
                <li>
                    <a class="icon i2 icon-question-circle" title="帮助" href="#"></a>
                </li>
                <li>
                    <a class="icon i2 icon-info-circle" title="关于" href="#"></a>
                </li>
                <li>
                    <a class="icon i2 icon-power-off" title="退出" href="login.html"></a>
                </li>
            </ul>
        </div>
    </div>



    <div class="sa-lay">
        <div class="sa-panel sa-responsive fl mt20" style="width:1218px;">
            <div class="sa-header">
                <div class="sa-header-con">
                    <!-- header 内容 -->
                    <ul class="sa-nav">
                        <li><a href="javascript:void(0)" data-toggle="tab" data-target=".data-log" class="sa-tab">系统日志</a></li>
                        <li><a href="javascript:void(0)" data-toggle="tab" data-target=".data-info" class="sa-tab on">我的信息</a>
                        </li>
                    </ul>
                </div>
                <div class="sa-header-right"></div>
            </div>
            <div class="sa-content">
                <div class="sa-con-inner">
                    <div class="sa-inner-content">
                        <!-- s -->

                        <!-- 内容区域 -->
                        <div class="data-log" data-role="tab-page" style="display: none;">
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>用户名</th>
                                        <th>时间</th>
                                        <th>IP</th>
                                        <th>操作内容</th>
                                    </tr>
                                </thead>
                                <tbody></tbody>
                                <tfoot>
                                    <tr>
                                        <td colspan="5">
                                            <div class="pagination"></div>
                                            <!-- End .pagination -->
                                            <div class="clearfix"></div>
                                        </td>
                                    </tr>
                                </tfoot>
                            </table>
                        </div>
                        <!-- 内容区域end -->

                        <!-- 内容区域 -->
                        <div class="data-info" data-role="tab-page">
                            <ul class="info-box">
                                <li><label>编号：</label><span class="info-item">227</span></li>
                                <li><label>所属单位：</label><span class="info-item">浙江新迪嫁园农业有限公司</span></li>
                                <li><label>用户角色：</label><span class="info-item">  </span></li>
                                <li><label>登录账户：</label><span class="info-item" id="userName">shengchan</span></li>
                                <li><label>真实姓名：</label><span class="info-item" id="truename">郭光</span></li>
                                <li><label>性别：</label><span class="info-item" id="sex">男</span></li>
                                <li><label>手机号：</label><span class="info-item" id="mobile"></span></li>
                                <li><label>操作：</label><span class="info-item modify-box">
              <a href="javascript:void(0);" id="modifyInfo" class="modify" kesrc="#data">修改信息</a></span></li>
                            </ul>
                        </div>
                        <!-- 内容区域end -->
                        <!-- e s -->

                    </div>
                </div>
            </div>
            <div class="sa-footer">
                <div class="sa-footer-con"></div>
                <div class="sa-footer-right"></div>
            </div>
        </div>
    </div>



    <div id="footer">

    </div>


    <script type="text/javascript">
        AM.ready("init2");
        $(function() {
            oplogList(1);
            $("#modifyInfo").fancybox({
                'hideOnContentClick': false,
                'titlePosition': 'outside',
                'href': 'components/center/goedit/goedit.html',
                'type': 'iframe',
                'overlayColor': '#000',
                'overlayOpacity': 0.3,
                'transitionIn': 'elastic',
                'transitionOut': 'elastic',
                'autoDimensions': false,
                'showCloseButton': false,
                'width': 600,
                'height': 510,
                'padding': 0,
                'scrolling': 'no',
                'onClosed': function() {}
            });
        });

        function oplogList(pageNo) {
            $.ajax({
                type: 'POST',
                url: '/user/center/oplog',
                data: {
                    pageNo: pageNo,
                    pageSize: 15
                },
                dataType: "json",
                cache: false,
                success: function(page) {
                    if (page) {
                        var $list = page['list'];
                        $('.data-log tbody').html("");
                        var $len = $list.length;
                        if ($len) {
                            for (var i = 0, j = $len; i < j; i++) {
                                var $tr = $("<tr id='" + $list[i].logId + "'></tr>");
                                $tr.append("<td>" + $list[i].logId + "</td>");
                                $tr.append("<td>" + $list[i].username + "</td>");
                                $tr.append("<td>" + timeStamp2String($list[i].createTime) + "</td>");
                                $tr.append("<td>" + $list[i].logIp + "</td>");
                                $tr.append("<td>" + $list[i].content + "</td>");
                                $('.data-log tbody').append($tr);
                            }
                            tPagination(page.pageNo, page.recordCount, page.pageCount, "oplogList", null);
                        }
                    }
                },
                error: function() {}
            });
        }

        function keypress() {
            var flag = event.keyCode >= 48 && event.keyCode <= 57 || event.keyCode == 37 || event.keyCode == 39;
            return flag;
        }

        function keyup(totalPage, currentPage) {
            var val = $("#goPage").val();
            val = val.replace(/[^0-9]/g, "");
            $("#goPage").val(val);
            val = parseInt(val);
            if (0 >= val || val > totalPage) {
                val = currentPage;
                $("#goPage").val(val);
            }
            if (val == currentPage) {
                $("#gotoBtn").attr("disabled", "disabled");
            } else {
                $("#gotoBtn").removeAttr("disabled");
            }
        }

        function tPagination(currentPage, totalCount, totalPage, functionName, pageContainer) {
            var pageHTML = "";
            pageHTML += "<a class='noclick font-black'>共 " + totalPage + " 页</a>";
            if (currentPage <= 1) {
                pageHTML += "<a class='noclick'>&laquo;首页</a>" +
                    "<a class='noclick'>&laquo;上页</a>";
            } else {
                pageHTML += "<a href='javascript:void(0);' onclick='javascript:" + functionName + "(1);' onclick='" + functionName + "(1)'>&laquo;首页</a>" +
                    "<a href='javascript:void(0);' onclick='javascript:" + functionName + "(" + (currentPage - 1) + ");' onclick='" + functionName + "(" + (currentPage - 1) + ")'>&laquo;上页</a>";
            }
            var temp1 = (currentPage - 4) <= 1 ? 1 : currentPage - 4; //分页组件中间显示的起始页
            var temp2 = (temp1 + 9) > totalPage ? totalPage : temp1 + 9; //页数下标个数
            if ((temp2 - temp1 + 1) < 10) { //当下标个数小于规定的个数时
                temp1 = (temp2 - 9) <= 0 ? 1 : temp2 - 9;
            }
            for (var i = temp1; i <= temp2; i++) {
                if (i == currentPage) {
                    pageHTML += "<a href='javascript:void(0);' onclick='javascript:" + functionName + "(" + i + ");' class='number current'>" + i + "</a> ";
                } else {
                    pageHTML += "<a href='javascript:void(0);' onclick='javascript:" + functionName + "(" + i + ");' class='number'>" + i + "</a> ";
                }
            }
            if (currentPage >= totalPage) {
                pageHTML += "<a class='noclick'>下页&raquo;</a>" +
                    "<a class='noclick'>末页&raquo;</a>";
            } else {
                pageHTML += "<a href='javascript:void(0);' onclick='javascript:" + functionName + "(" + (currentPage + 1) + ");'>下页&raquo;</a>" +
                    "<a href='javascript:void(0);' onclick='javascript:" + functionName + "(" + totalPage + ");'>末页&raquo;</a>";
            }

            pageHTML += "<span class='input-append'><input id='goPage' class='span1' type='text' " +
                "value='" + currentPage + "'" +
                "onkeypress='return keypress();' " +
                "onkeyup='keyup(" + totalPage + "," + currentPage + ")' onpaste='return false;'>" +
                "<button class='btn btn-goto' id='gotoBtn' disabled type='button' onclick='" + functionName + "((document.getElementById(\"goPage\").value)?document.getElementById(\"goPage\").value:1);'>跳转</button></span>" +
                "<a class='noclick font-black'>记录数：" + totalCount + "</a>";
            if (pageContainer) {
                $("." + pageContainer).html(pageHTML);
            } else {
                $(".pagination").html(pageHTML);
            }
            if (totalCount == 0) {
                $("#goPage").val(0);
                $("#goPage").attr("readonly", "readonly");
                $("#gotoBtn").attr("disabled", "disabled");
            }
        }

        function reSetInfo(sex, truename, mobile) {
            $('#sex').html(sex == 1 ? "男" : "女");
            $('#truename').html(truename);
            $('#mobile').html(mobile);

        }
    </script>
</body>